/*
 * Wazuh databaseFeedManager
 * Copyright (C) 2015, Wazuh Inc.
 * January 11, 2024.
 *
 * This program is free software; you can redistribute it
 * and/or modify it under the terms of the GNU General Public
 * License (version 2) as published by the FSF - Free Software
 * Foundation.
 */
#ifndef _TRAMPOLINE_FACTORYORCHESTRATOR_HPP
#define _TRAMPOLINE_FACTORYORCHESTRATOR_HPP

#include "MockDatabaseFeedManager.hpp"
#include "MockFactoryOrchestrator.hpp"
#include "MockIndexerConnector.hpp"
#include "TrampolineScanContext.hpp"

extern std::shared_ptr<MockFactoryOrchestrator> spFactoryOrchestratorMock;

/**
 * @brief This class is a wrapper of the trampoline indexer connector library.
 */
class TrampolineFactoryOrchestrator final
{
public:
    /**
     * @brief Constructor.
     *
     */
    TrampolineFactoryOrchestrator() = default;

    /**
     * @brief Destructor.
     *
     */
    virtual ~TrampolineFactoryOrchestrator() = default;

    /**
     * @brief Mock method for creating an orchestrator and returns it.
     *
     * @param type Scanner type.
     * @param databaseFeedManager DatabaseFeedManager object.
     * @param indexerConnector Indexer connector object.
     * @param inventoryDatabase Inventory database.
     * @param reportDispatcher Report queue instance.
     * @return std::shared_ptr<ScanContext> Abstract handler.
     * @param subOrchestration Suborchestration to forward messages.
     */
    static std::shared_ptr<MockAbstractHandler<std::shared_ptr<TrampolineTScanContext>>>
    create(ScannerType type,
           std::shared_ptr<MockDatabaseFeedManager> databaseFeedManager,
           std::shared_ptr<MockIndexerConnector> indexerConnector,
           Utils::RocksDBWrapper& inventoryDatabase,
           std::shared_ptr<ReportDispatcher> reportDispatcher,
           std::shared_ptr<MockAbstractHandler<std::shared_ptr<TrampolineTScanContext>>> subOrchestration = nullptr)
    {
        return spFactoryOrchestratorMock->create();
    }
};

#endif //_TRAMPOLINE_FACTORYORCHESTRATOR_HPP
